package com.sinog.front.controller.api.xml;

import com.sinog.core.model.UserDTO;
import com.sinog.core.utilbean.Result;
import com.sinog.front.feign.biz.xml.InterfaceXjService;
import com.sinog.front.service.user.UserFacade;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * @desc 湖南个性化接口对接-Controller
 * @author LK
 * @date 2022/6/27 下午3:00
 */
@RestController
public class InterfaceXjController {

    @Autowired
    private UserFacade userService;
    @Resource
    private InterfaceXjService interfaceXjService;

    /**
     * 信息补录接口
     * 职业技能-减刑假释-出监评估
     * @param data data
     * @return Result
     */
    @RequestMapping("/transmission/azbj/informationBl/save")
    public Result saveInformationBl(@RequestParam Map<String, List<Map<String, String>>>  data){
        UserDTO user = userService.getAuthentication();
        return interfaceXjService.saveInformationBl(data,user);
    }

    @RequestMapping("/transmission/azbj/yazgl/xj/insert")
    public Result insertXjxx(@RequestParam Map<String, List<Map<String, String>>> data) {
        //查询流程中上传表单所有服务器端文件
        UserDTO userDTO = userService.getAuthentication();
        /*
         * 校验是否上传刑满释放人员通知书
         * 1、山西-看守所在释放时才有释放通知书，在发起衔接时，暂时没有文件 其他省情况相同
         */
        return interfaceXjService.insertXjxxInface(data,userDTO);
    }
}